package com.zzwtec.interfaces.information.services;

import java.util.List;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.zzwtec.common.constant.AppName;
import com.zzwtec.interfaces.Page;
import com.zzwtec.interfaces.RequestObject;
import com.zzwtec.interfaces.ResultObject;
import com.zzwtec.interfaces.information.dto.RoleDTO;

/**
 * @FeignClient需要指向接口实现者的应用名比如(com.zzwtec.information)
 * @author  草原狼
 * 
 * 2017年08月07日
 */
@FeignClient(AppName.ZZWTEC_INFORMATION)
@RequestMapping("RoleService")
public interface RoleService {

	/**
	 * 添加Role
	 * 
	 * @param bean
	 * @return 
	 */
	@RequestMapping(value = "addRole", method = RequestMethod.POST)
	public ResultObject<String> addRole(@RequestBody RequestObject<RoleDTO> request);

	/**
	 * 按id删除Role
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "removeRole", method = RequestMethod.POST)
	public ResultObject<Void> removeRole(@RequestBody RequestObject<String> id);

	/**
	 * 按ids删除Role
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "removeRoleByIds", method = RequestMethod.POST)
	public ResultObject<Void> removeRoleByIds(@RequestBody RequestObject<String[]> request);
	
	/**
	 * 修改Role
	 * @param bean
	 * @return
	 */	
	@RequestMapping(value = "modifyRole", method = RequestMethod.POST)
	public ResultObject<Void> modifyRole(@RequestBody RequestObject<RoleDTO> request);

	/**
	 * 查询所有Role
	 * 
	 * @return
	 */	
	@RequestMapping(value = "queryAllRole", method = RequestMethod.POST)
	public ResultObject<List<RoleDTO>> queryAllRole(@RequestBody RequestObject<Void> request);

	/**
	 * 根据id查询Role
	 * 
	 * @param id
	 * @return
	 */	
	@RequestMapping(value = "queryRoleById", method = RequestMethod.POST)
	public ResultObject<RoleDTO> queryRoleById(@RequestBody RequestObject<String> request);
	
	
	
	/**
     * 获取分页Role数据
     * @param page 分页数据
     * @return 区域分页数据
     */	
	@RequestMapping(value = "queryRoleByPage", method = RequestMethod.POST)
	public ResultObject<Page<RoleDTO>> queryRoleByPage(@RequestBody RequestObject<Page<RoleDTO>> request);

	/**
	 * 本地服务实例的信息
	 * @return ServiceInstance
	 */
	@RequestMapping(value = "instance-info", method = RequestMethod.GET)
	public ServiceInstance showServiceInfo();
}
